<!DOCTYPE html>
<html  xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>[[${configs.title}]]</title>
    <link rel="stylesheet" href="/statics/layui-v2.8.15/css/layui.css">
    <style type="text/css">
        .layadmin-iframe {
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0
        }
    </style>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">[[${configs.title}]]</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;" style="margin-right: 5px;">
                    [[${username}]]
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;" id="edit-password">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="javascript:;" id="logout">退出登录</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed layui-this">
                    <a href="/admin/home" target="frame">控制台</a>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">公众号管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/wechat" target="frame">公众号列表</a></dd>
                        <dd><a href="/admin/wechat/add" target="frame">添加公众号</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">消息管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/message" target="frame">消息列表</a></dd>
                        <dd><a href="/admin/message/count" target="frame">消息统计</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">日志管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/log" target="frame">日志列表</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-body" id="layui-body">
        <iframe id="main" src="/admin/home" name="frame" frameborder="0" scrolling="yes" class="layadmin-iframe"></iframe>
    </div>
    <div class="layui-footer">
        <p>Copyright © 2022 - [[${year}]] [[${configs.copyright}]]</p>
    </div>
</div>
<script src="/statics/layui-v2.8.15/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function() {
        let element = layui.element,$ = layui.jquery, layer = layui.layer;
        $("#edit-password").click(function () {
            $("#main").attr("src","/admin/user/edit-password");
        })
        $("#logout").click(function () {
            layer.confirm("确认退出登录吗？", function (index) {
                location.href = location.protocol + "//" + location.hostname + (location.port !== "80"? ':' + location.port : '') + '/admin/user/logout';
                layer.close(index);
            });
        });
    });
</script>
</body>

</html>